package vin.echo.core.web;

import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

import org.apache.log4j.BasicConfigurator;

import vin.echo.core.ServiceContext;
import vin.echo.core.configure.WebXmlConfiguration;

/**
 * Application Lifecycle Listener implementation class InitAllManager
 *
 */
public class DoorKnocker implements ServletContextListener {
	
	
    /**
     * Default constructor. 
     */
    public DoorKnocker() {
    }

	/**
     * @see ServletContextListener#contextInitialized(ServletContextEvent)
     */
    public void contextInitialized(ServletContextEvent arg0) {
    	BasicConfigurator.configure();
    	
    	ServletContext context = arg0.getServletContext();
    	ServiceContext.configure(new WebXmlConfiguration(context));
    }

	/**
     * @see ServletContextListener#contextDestroyed(ServletContextEvent)
     */
    public void contextDestroyed(ServletContextEvent arg0) {
    	
    }
	
}
